﻿
/*******************************************************************************************
// ©2009 Microsoft Corporation.  This code is provided under the Microsoft Public License.
*******************************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ClientBilling
{
    /// <summary>
    /// Represents the amount of a call allocated to a specific case.
    /// </summary>
    public class CaseAllocation
    {
        public Case Case { get; set; }
        public decimal PortionOfCall { get; set; }

        public CaseAllocation(Case c)
        {
            if (c == null)
            {
                throw new ArgumentNullException("The case cannot be null.");
            }

            Case = c;
        }

        public string CaseName
        {
            get
            {
                return Case.Description ?? string.Empty;
            }
        }

        public string CaseNumber
        {
            get
            {
                return Case.Number ?? string.Empty;
            }
        }

        /// <summary>
        /// Retrieve an entirely new CaseAllocation object with the same information.
        /// </summary>
        public CaseAllocation GetShallowCopy()
        {
            return (CaseAllocation)this.MemberwiseClone();
        }
    }
}
